package com.example.rabbit.enums;

import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @description: topic交换机
 */
@Getter
@NoArgsConstructor
public enum TopicEnum {


    /**
     * 同步到check数据库的sql
     */
    CHECK_SQL("check_sql_exchange", "check_sql_queue", "#"),
    ;


    /**
     * 交换机名称
     */
    private String exchange;


    /**
     * 队列名称
     */
    private String queue;

    /**
     * 路由
     */
    private String routingKey;

    /**
     * 消息存活时间,该参数是非负整数值.创建queue时设置该参数可指定消息在该queue中待多久，
     */
    private Integer ttl;


    TopicEnum(String exchange, String queue, String routingKey) {
        this.exchange = exchange;
        this.queue = queue;
        this.routingKey = routingKey;
    }

    TopicEnum(String exchange, String queue, String routingKey, Integer ttl) {
        this.exchange = exchange;
        this.queue = queue;
        this.routingKey = routingKey;
        this.ttl = ttl;
    }
}
